#include <QByteArray>
#include <QXmlAttributes>
#include <QXmlStreamReader>
#include <QString>
#include <QDebug>
#include <QDateTime>

#include "kukaforcecontrolbackend.h"
#include "_Interface/_global_datastruct.h"
#include "Package/kukarsiudpserverdll_global.h"
#include "Package/simpletcpsocketdll_global.h"

kukaforceguidebackend::kukaforceguidebackend(){
    this->mSRIForceSensor = GetSRIForceSensorInstance();
    this->mKuKaRsiSensroGuide = GetKuKaRsiSensorGuideInstance();
}

kukaforceguidebackend::~kukaforceguidebackend(){

}

short kukaforceguidebackend::KUKAProcess(){
    if(this->mKuKaRsiSensroGuide->KUKADataRecv()){
/*************USERCODE-BEGIN****************/

/**************USERCODE-END*****************/
        this->mKuKaRsiSensroGuide->KUKADataSend();
        return 1;
    }
    return 0;
}

short kukaforceguidebackend::getKUKARIst(double (&KUKARIst)[6]){
   return this->mKuKaRsiSensroGuide->getKUKARIst(KUKARIst);
}
short kukaforceguidebackend::getKUKAAIst(double (&KUKAAIst)[6]){
   return this->mKuKaRsiSensroGuide->getKUKAAIst(KUKAAIst);
}
short kukaforceguidebackend::getKUKAATor(double (&KUKAATor)[6]){
   return this->mKuKaRsiSensroGuide->getKUKAATor(KUKAATor);
}
short kukaforceguidebackend::setKUKARInc(double KUKARInc[6]){
   return this->mKuKaRsiSensroGuide->setKUKARInc(KUKARInc);
}

short kukaforceguidebackend::ForceSensorConnect(){
    return this->mSRIForceSensor->ForceSensorConnect("192.168.1.108",4008);
}
short  kukaforceguidebackend::ForceSensorLoopRun(){
    this->mSRIForceSensor->ForceSensorLoopRun();
    return NOERROR;
}
short  kukaforceguidebackend::ForceSensorZeroDeal(){
    this->mSRIForceSensor->ForceSensorZeroDeal();
    return NOERROR;
}
short kukaforceguidebackend::ReadForceSensorData(double (&Data)[6]){
    return this->mSRIForceSensor->ReadForceSensorData(Data);
}
